import request from "@/utils/request";

// 封装获取文章列表数据方法
export const getArticleList = (obj) => {
  return request.get('/admin/interview/query', {
    params: {
      current: obj.current,
      pageSize: obj.pageSize
    }
  })
}

// 封装添加面经的方法
export const addArticle = (obj) => {
  return request.post('/admin/interview/create', {
    stem: obj.stem,
    content: obj.content
  })
}

// 封装获取面经文章详情的方法
export const getArticleDetail = (id) => {
  return request.get('/admin/interview/show', {
    params: {
      id
    }
  })
}

// 封装修改面经的方法
export const editArticle = (obj) => {
  return request.put('/admin/interview/update', {
    id: obj.id,
    stem: obj.stem,
    content: obj.content
  })
}

// 封装删除面经的方法
export const deleteArticle = (id) => {
  return request.delete('/admin/interview/remove', {
    data: {
      id
    }
  })
}
